1. /* swhatime.cpp by K.Tsuru */
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <sstream>
  5. using namespace std;
  6. string WhatTimeNow() { // return the present time in string hh:mm:ss
  7. time_t st = time(NULL);
  8. struct tm *pnow = localtime(&st);
  9. stringstream now;
  10. now.width(2); now.fill('0');
  11. now << pnow->tm_hour << ':' << pnow->tm_min << ':' << pnow->tm_sec;
  12. return (string)now.str();
  13. }

swhatime.cpp : last modifiled at 2017/04/10 10:10:40(402 bytes)
created at 2017/10/03 15:04:05
The creation time of this html file is 2017/10/07 10:54:16 (Sat Oct 07 10:54:16 2017).